<template>
	<div class="navgatorBar">
		<header>
			八维社区团购门店端
		</header>
		<div class="address">
			<span>
				位置：{{address}}
			</span>
			<div class="navigator" v-if="src.title!==''" @click="handleJump(src.url)">{{src.title}}</div>
		</div>
	</div>
</template>

<script>
	export default {
		name: "navigator",
		props: {
			src: {
				default: {
					title: "",
					url: ""
				}
			}
		},
		data() {
			return {
				address: "八维宏烨"
			};
		},
		methods: {
			// 点击跳转路由页面
			handleJump(url) {
				console.log(url)
				if(url=="/pages/shop/index/index"||url=="/pages/home/index/index"||url=="pages/person/index/index"){
					uni.switchTab({
						url:url
					});
				}else{
					uni.redirectTo({
					url:url
				});
				}
				
			}
		}
	}
</script>

<style lang="scss">
	.navgatorBar {
		width: 100%;
		height: auto;

		header {
			width: 100%;
			height: 80px;
			background: #878dff;
			display: flex;
			align-items: center;
			padding-left: 50px;
			color: #fff;
			font-size: 22px;
			font-weight: 500;
			font-family: "华文楷体";
		}

		.address {
			width: 100%;
			height: 40px;
			background: #F0F0F0;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-family: "华文楷体";

			>span {
				margin-left: 15px;
			}

			>.navigator {
				margin-right: 15px;
				width: auto;
				color: blue;
			}
		}
	}
</style>
